package com.lion.hbase.model;

import java.util.Date;

import com.lion.hbase.annotation.HTable;
import com.lion.hbase.api.HbaseTableModel;
import com.lion.hbase.util.TimeUtil;
import com.lion.hbase.util.TimeUtil.Format;

@HTable(name = "Lion", family = "DATA")
public class Lion implements HbaseTableModel {
	private String name;
	private int age;
	private long hight;
	private Date birth;

	@Override
	public byte[] getKey() {
		return (age + TimeUtil.getDateString(birth, Format.SHORT) + name)
				.getBytes();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public long getHight() {
		return hight;
	}

	public void setHight(long hight) {
		this.hight = hight;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	@Override
	public String toString() {
		return "Lion [name=" + name + ", age=" + age + ", hight=" + hight
				+ ", birth=" + birth + "]";
	}

}
